package com.xique.door.project.miniprogram.controller;

import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.project.miniprogram.service.IMiniResourceBitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 资源图片视频
 */
@RestController
@RequestMapping("/mini/resourceBit")
public class MiniResourceBitController {

    @Autowired
    private IMiniResourceBitService miniResourceBitService;

    @GetMapping("/getList")
    public AjaxResult getMiniInformationList(String resourceType, String position, String positionType) {
        if (position.equals("2") ) {
            if(positionType==null||"".equals(positionType)){
                positionType = "1";
            }
        }
        return AjaxResult.success(miniResourceBitService.getResourceBitList(resourceType, position, positionType));
    }

    @GetMapping("/getPopup")
    public AjaxResult getPopup(String resourceType,String positionType){
        return AjaxResult.success(miniResourceBitService.getPopup(resourceType,positionType));
    }
}
